#ifndef CALENDARINFO_H
#define CALENDARINFO_H

#include <QWidget>
#include <QObject>
#include <QList>

class CalendarInfo : public QObject
{
    Q_OBJECT
public:
    CalendarInfo(QObject *parent = 0);

    static CalendarInfo *Instance();
    static QScopedPointer<CalendarInfo> self;


    QList<int > lunarCalendarTable;
    QList<int > springFestival;
    QList<int > lunarData;
    QList<int > chineseTwentyFourData;
    QList<int > monthAdd;

    QList<QString > listDayName;
    QList<QString > listMonthName;
    QList<QString > listSolarTerm;

    QList<QString > listTianGan;
    QList<QString > listDiZhi;
    QList<QString > listShuXiang;

    int getMonthDays(int year, int month);
    bool isLoopYear(int year);
    int getTotalMonthDays(int year, int month);
    int getFirstDayOfWeek(int year, int month);
    QString getHoliDay(int month, int day);
    QString getSolarTerms(int year, int month, int day);
    QString getLunarFestival(int month, int day);
    QString getLunarYear(int year);
    void getLunarCalendarInfo(int year, int month, int day, QString &holiday,\
                              QString &solarTerms, QString &lunarFestival,\
                              QString &lunarYear, QString &lunarMonth, QString &lunarDay);
    QString getLunarInfo(int year, int month, int day, bool yearInfo, bool monthInfo, bool dayInfo);
    QString getLunarYearMonthDay(int year, int month, int day);
    QString getLunarMonthDay(int year, int month, int day);
    QString getLunarDay(int year, int month, int day);
};

#endif // CALENDARINFO_H
